package cn.gson.springboot.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the prescription_px database table.
 * 
 */
@Entity
@Table(name="prescription_px")
@NamedQuery(name="PrescriptionPx.findAll", query="SELECT p FROM PrescriptionPx p")
public class PrescriptionPx implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="prescription_id")
	private int prescriptionId;

	@Temporal(TemporalType.TIMESTAMP)
	private Date prescribing_date;

	@Column(name="prescription_content")
	private String prescriptionContent;

	@Column(name="prescription_money")
	private BigDecimal prescriptionMoney;

	@Column(name="prescription_name")
	private String prescriptionName;

	@Column(name="prescription_state")
	private int prescriptionState;

	//bi-directional many-to-one association to PrescriptionDetailsPx
	@OneToMany(mappedBy="prescriptionPx")
	private List<PrescriptionDetailsPx> prescriptionDetailsPxs;

	//bi-directional many-to-one association to RegisteredPx
	@ManyToOne
	@JoinColumn(name="outpatient_id")
	private RegisteredPx registeredPx;

	//bi-directional many-to-one association to ReturnYf
	@OneToMany(mappedBy="prescriptionPx")
	private List<ReturnYf> returnYfs;

	//bi-directional many-to-one association to Spenddetai
	@OneToMany(mappedBy="prescriptionPx")
	private List<Spenddetai> spenddetais;

	//bi-directional many-to-one association to YfChangerPx
	@OneToMany(mappedBy="prescriptionPx")
	private List<YfChangerPx> yfChangerPxs;

	public PrescriptionPx() {
	}

	public int getPrescriptionId() {
		return this.prescriptionId;
	}

	public void setPrescriptionId(int prescriptionId) {
		this.prescriptionId = prescriptionId;
	}

	public Date getPrescribing_date() {
		return this.prescribing_date;
	}

	public void setPrescribing_date(Date prescribing_date) {
		this.prescribing_date = prescribing_date;
	}

	public String getPrescriptionContent() {
		return this.prescriptionContent;
	}

	public void setPrescriptionContent(String prescriptionContent) {
		this.prescriptionContent = prescriptionContent;
	}

	public BigDecimal getPrescriptionMoney() {
		return this.prescriptionMoney;
	}

	public void setPrescriptionMoney(BigDecimal prescriptionMoney) {
		this.prescriptionMoney = prescriptionMoney;
	}

	public String getPrescriptionName() {
		return this.prescriptionName;
	}

	public void setPrescriptionName(String prescriptionName) {
		this.prescriptionName = prescriptionName;
	}

	public int getPrescriptionState() {
		return this.prescriptionState;
	}

	public void setPrescriptionState(int prescriptionState) {
		this.prescriptionState = prescriptionState;
	}

	public List<PrescriptionDetailsPx> getPrescriptionDetailsPxs() {
		return this.prescriptionDetailsPxs;
	}

	public void setPrescriptionDetailsPxs(List<PrescriptionDetailsPx> prescriptionDetailsPxs) {
		this.prescriptionDetailsPxs = prescriptionDetailsPxs;
	}

	public PrescriptionDetailsPx addPrescriptionDetailsPx(PrescriptionDetailsPx prescriptionDetailsPx) {
		getPrescriptionDetailsPxs().add(prescriptionDetailsPx);
		prescriptionDetailsPx.setPrescriptionPx(this);

		return prescriptionDetailsPx;
	}

	public PrescriptionDetailsPx removePrescriptionDetailsPx(PrescriptionDetailsPx prescriptionDetailsPx) {
		getPrescriptionDetailsPxs().remove(prescriptionDetailsPx);
		prescriptionDetailsPx.setPrescriptionPx(null);

		return prescriptionDetailsPx;
	}

	public RegisteredPx getRegisteredPx() {
		return this.registeredPx;
	}

	public void setRegisteredPx(RegisteredPx registeredPx) {
		this.registeredPx = registeredPx;
	}

	public List<ReturnYf> getReturnYfs() {
		return this.returnYfs;
	}

	public void setReturnYfs(List<ReturnYf> returnYfs) {
		this.returnYfs = returnYfs;
	}

	public ReturnYf addReturnYf(ReturnYf returnYf) {
		getReturnYfs().add(returnYf);
		returnYf.setPrescriptionPx(this);

		return returnYf;
	}

	public ReturnYf removeReturnYf(ReturnYf returnYf) {
		getReturnYfs().remove(returnYf);
		returnYf.setPrescriptionPx(null);

		return returnYf;
	}

	public List<Spenddetai> getSpenddetais() {
		return this.spenddetais;
	}

	public void setSpenddetais(List<Spenddetai> spenddetais) {
		this.spenddetais = spenddetais;
	}

	public Spenddetai addSpenddetai(Spenddetai spenddetai) {
		getSpenddetais().add(spenddetai);
		spenddetai.setPrescriptionPx(this);

		return spenddetai;
	}

	public Spenddetai removeSpenddetai(Spenddetai spenddetai) {
		getSpenddetais().remove(spenddetai);
		spenddetai.setPrescriptionPx(null);

		return spenddetai;
	}

	public List<YfChangerPx> getYfChangerPxs() {
		return this.yfChangerPxs;
	}

	public void setYfChangerPxs(List<YfChangerPx> yfChangerPxs) {
		this.yfChangerPxs = yfChangerPxs;
	}

	public YfChangerPx addYfChangerPx(YfChangerPx yfChangerPx) {
		getYfChangerPxs().add(yfChangerPx);
		yfChangerPx.setPrescriptionPx(this);

		return yfChangerPx;
	}

	public YfChangerPx removeYfChangerPx(YfChangerPx yfChangerPx) {
		getYfChangerPxs().remove(yfChangerPx);
		yfChangerPx.setPrescriptionPx(null);

		return yfChangerPx;
	}

}